﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Cua_Hang
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Load_CuaHang_MenuNgang();
            this.Load_CuaHang_MenuTrai();
            //string ID_cuahang1 = Request.QueryString["ID_cuahang"];
            this.Load_ToaDo_KhachHang();
            this.Load_DiaChiCuaHang();

        }

        //------------------------------------

        void Load_CuaHang_MenuNgang()
        {
            Repeater1.DataSource = Cua_Hang.BUS.Cua_Hang_BUS.ListCuaHangAll_BUS();
            Repeater1.DataBind();

        }

        //-----------------------------------
        int ID_cuahang;
        void Load_CuaHang_MenuTrai()
        {

            string ID_cuahang1 = Request.QueryString["ID_cua_hang"];
            ID_cuahang = Convert.ToInt32(ID_cuahang1);
            if (ID_cuahang == 0)
            {
                Repeater2.DataSource = Cua_Hang.BUS.ChiTiet_CuaHang_BUS.ListChiTiet_CuaHangAll_BUS(2);
                Repeater2.DataBind();
            }
            else
            {
                Repeater2.DataSource = Cua_Hang.BUS.ChiTiet_CuaHang_BUS.ListChiTiet_CuaHangAll_BUS(ID_cuahang);
                Repeater2.DataBind();
            }

        }
        //---------------------------------------
        void Load_ToaDo_KhachHang()
        {

            string ID_cuahang1 = Request.QueryString["ID_cua_hang"];
            ID_cuahang = Convert.ToInt32(ID_cuahang1);
            if (ID_cuahang == 0)
            {
                Repeater3.DataSource = Cua_Hang.BUS.ToaDo_KhachHang_BUS.List_ToaDoKhachHang_BUS(2);
                Repeater3.DataBind();
            }
            else
            {
                Repeater3.DataSource = Cua_Hang.BUS.ToaDo_KhachHang_BUS.List_ToaDoKhachHang_BUS(ID_cuahang);
                Repeater3.DataBind();
            }

        }


        //------------------------------------


        //---------------------------------------
        void Load_DiaChiCuaHang()
        {

            string ID_cuahang1 = Request.QueryString["ID_cua_hang"];
            ID_cuahang = Convert.ToInt32(ID_cuahang1);
            if (ID_cuahang == 0)
            {
                Repeater4.DataSource = Cua_Hang.BUS.DiaChi_CuaHang_BUS.List_DiaChiCuaHang_BUS(2);
                Repeater4.DataBind();
            }
            else
            {
                Repeater4.DataSource = Cua_Hang.BUS.DiaChi_CuaHang_BUS.List_DiaChiCuaHang_BUS(ID_cuahang);
                Repeater4.DataBind();
            }

        }


        //------------------------------------

    }
}